#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int abs(int a)
    {
        return a > 0 ? a : -a;
    }
    int scoreOfString(string s) {
        int res = 0;
        for (int i = 0; i < s.size() - 1; i++)
        {
            res += abs(s[i] - s[i + 1]);
        }
        return res;
    }
};